-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve font family and emoji #13241
Conversation
@@ -2,6 +2,37 @@ | |||
font-family: 'JetBrainsMono-Regular'; | |||
src: url(../fonts/JetBrainsMono-2.304/JetBrainsMono-Regular.woff2) format('woff2'); | |||
} | |||
@font-face { | |||
font-family: "Number Glyphs"; | |||
src: /* 如果设置了编辑器字体,这里应该先加载${window.siyuan.config.editor.fontFamily},但我不懂怎么弄 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不弄会有什么问题?搞不了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实也不是必须插到这里来,但我不懂 CSS 我也不知道要插到哪里去,等会我换个方法
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 204 in 65f55b0
let style = `.b3-typography, .protyle-wysiwyg, .protyle-title {font-size:${window.siyuan.config.editor.fontSize}px !important} |
加在这里行不?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得应该可以,但这个我不会改。你帮我改一下试试
# Conflicts: # app/appearance/themes/daylight/theme.css # app/appearance/themes/midnight/theme.css
@Vanessa219 这个看起来是全平台都用 Noto-COLRv1.woff2 作为 emoji 字体了吗? |
@Vanessa219 字体没能正确加载,但我不懂这个: |
提交了,星号问题应该是 unicode-range 没有和 https://github.com/siyuan-note/siyuan/blob/f5731450885dd05473001dd0100261690157ce9c/app/appearance/emojis/conf.json 真正的对应。只要 conf.json 里面没有的都会有问题,比如 #。还麻烦一一核对一下。 共 1943 个 emoji |
这个作者已经一年没更新了。我看了一下代码是不是很懂css o!o)。官方不尝试接回或者新增字体编辑页面,用不惯可以尝试回退 |
试了一下,Windows 下文本中的 emoji 就会和 emoji 面板中的不一致了,除非把这几个从 emoji 中移除。 |
* commit '7d34a87da4c2c5f2324a2dee9d8da1f576f415fe': (234 commits) 🎨 tag 颜色 🔖 Release v3.1.16 📝 Update changelogs 🚨 🎨 siyuan-note#12209 🎨 Improve tag escaping 🎨 siyuan-note#13524 🎨 siyuan-note#13523 🔥 Remove Sentry reporting diagnostic data siyuan-note#13522 🎨 Improve exporting data siyuan-note#13500 🔥 Remove Sentry reporting diagnostic data siyuan-note#13522 📝 Update changelogs 🎨 siyuan-note#13522 🎨 siyuan-note#13241 🎨 siyuan-note#13241 🎨 search 🎨 siyuan-note#12335 🎨 Improve exporting data siyuan-note#13500 🎨 siyuan-note#13440 🎨 Improve exporting data siyuan-note#13500 ...
* Improve font family and emoji (siyuan-note#45) fix siyuan-note#13213 siyuan-note#13187 * 补充字体 LICENSE * 去除新增的变量 * 优先使用自定义字体的数字字形;更新 --b3-font-family-emoji * 代码中的数字字形应使用 JetBrainsMono-Regular
关联 #13219 ;fix #13213 #13187 https://ld246.com/article/1733233360780
有的字体可能会自带部分 emoji 字形,按照目前的 font-family 会覆盖其他 emoji 字体的字形,导致不同风格的 emoji 混杂在一起显示:#13213。
为了解决这个问题,应该把 emoji 字体放到前面去,但 emoji 字体里也会包含非 emoji 的字形(比如数字、英文字母),所以在显示的时候需要将范围(unicode-range)限定在思源的表情选择器中存在的 emoji,按照以下顺序覆盖:
在 Windows 系统没有能正常显示“区域指示符字母”、“国旗”和 Unicode 16.0 新增 emoji 的字体,所以需要添加一个内置的字体用来兜底显示 emoji :Noto-COLRv1.ttf(转换为.woff2)
顺便解决这个地方跟笔记本图标不一致的问题: